﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UlsStudio.AppCore
{
    /// <summary>
    /// Represents a grid-search setting
    /// </summary>
    public class GridSearchSettings
    {
        #region Constructors
        public GridSearchSettings()
        {
            this.SearchText = string.Empty;
            this.SearchDown = true;
        }
        public GridSearchSettings(string searchText, bool searchDown)
            : this()
        {
            this.SearchText = searchText;
            this.SearchDown = searchDown;
        }
        #endregion

        /// <summary>
        /// Text to search for
        /// </summary>
        public string SearchText { get; set; }

        /// <summary>
        /// Search down the grid or not (upwards if not).
        /// </summary>
        public bool SearchDown { get; set; }

        /// <summary>
        /// Does this object represent a user-set search?
        /// </summary>
        public bool IsSearchDefined
        {
            get
            {
                return !string.IsNullOrEmpty(this.SearchText);
            }
        }
    }
}
